
import React from 'react'
import { connect } from 'dva'
import { Alert, Form, Button, Modal, Popover, Table, Row, Col, Input, Select, message, Icon, Checkbox, Radio, Tooltip, Tabs, DatePicker } from 'antd'
import config from 'config/config'
import { mapStateToProps } from 'utils/view_utils'
import styles from './homeBannerDetailStyle.less'
import classnames from 'classnames/bind';
let cx = classnames.bind(styles);
import Uploader from 'widget/Upload'
import { isEmpty, isArray, cloneDeep, set, get, pick } from 'lodash'
import { CollapsiblePanels } from 'widget/CollapsiblePanels/index'
import SelectModal from 'widget/selectProjectModal/index'
import ListPage from 'widget/PageTmpl/ListPage'
import moment from 'moment';
import FlagBtn from 'widget/FlagBtn/FlagView'
const { TextArea } = Input;
const FormItem = Form.Item
const { RangePicker } = DatePicker
const objhref = {
  1: '推介',
  2: '秒杀竞拍',
  3: '资讯',
  4: '外部链接',
  5: '活动',
  6: '预约看房',
  7: '美房详情',
  8: '不跳转',
  9: '优惠券',
  10: '自助购房',
  11: '在线开盘',
  12: '小游戏',
  13: '直播',
  14: '活动专区'
}
///横幅配置成功10分钟生效

// console.log(clique,'clique')
// if(clique=='true'){
//   console.log(111)
// }else{
//   console.log(222)
// } 
const homeBannerDetailView = function ({ dispatch, model, form }) {
  const { getFieldDecorator, validateFields } = form
  const { modelObj, namespace } = model
  let { loadingGroup,advertisementId, auditDesc, ignoreReason, confirmAudit, query, city, actionType, clique, biz, local, gif, areaList1, btnLoading, currentItem = [], visible, localGif, channelIndex, hrefModalObj = {}, biz2 } = modelObj
  hrefModalObj.channel = channelIndex == 1 ? '101' : '201'
  const formItemLayout = {
    labelCol: { span: 2 },
    wrapperCol: { span: 8 },
  };
  const formItemLayoutForTime = {
    labelCol: { span: 2 },
    wrapperCol: { span: 20 },
  };
  const formItemLayout1 = {
    labelCol: { span: 8 },
    wrapperCol: { span: 12 },
  };
  const formItemLayoutStatus = {
    labelCol: { span: 4 },
    wrapperCol: { span: 14 },
  };
  const formItemLayout2 = {
    labelCol: { span: 4 },
    wrapperCol: { span: 16 },
  };

  const confirmHref = (getHref) => {
    let hrefInfo = {}
    let { visible = false, hrefType = '4', idx = 0, slideshowId = '' } = hrefModalObj
    hrefModalObj.visible = !visible
    query.linkType = hrefModalObj.hrefType
    // debugger
    // 判断类型，整合数据
    //

    if (hrefType == '4') {
      if ((hrefModalObj.linkUrl && !hrefModalObj.linkUrl.trim()) && (hrefModalObj.outerlinkUrl && !hrefModalObj.outerlinkUrl.trim())) {
        message.warn('请输入链接')
        return false
      }
      hrefModalObj.linkUrl = hrefModalObj.outerlinkUrl || hrefModalObj.linkUrl
      hrefInfo = getHref(cloneDeep(hrefModalObj))
    } else {
      console.log(biz[hrefType])
      let selectedRows = (biz[hrefType] || {})['selectedRows'] || {}
      let selectedRowKeys = (biz[hrefType] || {})['selectedRowKeys'] || {}
      if (isEmpty(selectedRowKeys) && hrefType != '8') {
        message.warn('请选择')
        return false
      } else {
        hrefModalObj.btnName = "",
          hrefModalObj.linkUrl = null
      }
      if (selectedRows[0]) {
        let obj = { ...cloneDeep(hrefModalObj), ...cloneDeep(selectedRows[0]) }
        hrefInfo = getHref(obj)
      } else {
        console.log(hrefModalObj)
        let obj = {
          ...cloneDeep(hrefModalObj),
          contentId: hrefModalObj.params && hrefModalObj.params.contentId,
          productId: hrefModalObj.params && hrefModalObj.params.productId,
          activeId: hrefModalObj.params && hrefModalObj.params.activeId
        }
        hrefInfo = getHref(obj)
      }
      console.log(hrefInfo, 'hrefInfo', hrefModalObj, 'hrefModalObj', cloneDeep(selectedRows[0]))
      currentItem = selectedRowKeys
    }
    hrefInfo.linkUrl = hrefInfo.linkUrl[Number(query.productType) || 1 - 1]
    hrefModalObj = { ...hrefModalObj, ...hrefInfo }
    Object.keys(biz).map((item, idx) => {
      if (hrefModalObj.hrefType != item) {
        biz[item].selectedRowKeys = []
      }
    })
    if (hrefType == '3' && query.productType == '0') {
      hrefModalObj.linkUrl = '/subPackages/pages/InformationDetail/InformationDetail?contentId=' + hrefModalObj.params.contentId
      hrefInfo = getHref(cloneDeep(hrefModalObj))
    }
    console.log(hrefModalObj)
    changeState({ hrefModalObj, currentItem, biz, query })
  }
  function getTopicList(channelIndex = '1') { //1美的置业云 2智美分销
    let rows = [
      {
        'id': '2',
        'title': '领优惠券',
        'linkUrl': '/pages/biz/my/myCoupons/couponsList/couponsList',
      },
    ]

    if (channelIndex == '2') {
      rows = cloneDeep([rows[0]])
    }
    let toppicList = {
      // "pageNo": 1,
      'pageSize': 10,
      'rows': cloneDeep(rows),
      'success': true,
      // "total": 150
    }
    return toppicList
  }
  let pageProps = {
    '1': {   //我要推介
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        api_url: 'admin/estate/adminList',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        selectedRowKeys: [],
        // 接口参数
        params: 'pageNo=1&pageSize=10&shelfStatus=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '城市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              changeOnSelect: true,
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },

          key: 'productId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'productCode',
              zh_name: '项目编号',
              // width: 150,
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              // width: 100,
            },
            {
              en_name: 'cityName',
              zh_name: '所属城市',
              width: 150,
              // width: 100,
              render: (a, item, index, d, e, f) => {
                //console.log(item)
                let arr = ['北京市', '重庆', '上海', '天津']
                if (arr.indexOf(item.provinceName) > -1) {
                  return item.cityName
                } else {
                  return `${item.provinceName || ''}${item.provinceName && item.cityName && ' - ' || ''}${item.cityName || ''}`
                }

              }
            },
            {
              en_name: 'shelfStatus',
              zh_name: '状态',
              width: 80,
              render: (a, item, index, d, e, f) => {
                let shelfStatus = ['', '已上架', '已下架', '未上架']
                return (
                  <span>{shelfStatus[item.shelfStatus]}</span>
                )
              }
            },
            {
              en_name: 'createPerson',
              zh_name: '创建人',
              // width: 100,
            },
            {
              en_name: 'createTime',
              zh_name: '创建时间',
              width: 180
            },
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '2': {   //专题活动
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        // api_url: "",
        api_url: 'admin/seckillActivity/advertList',
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        // 接口参数
        params: 'published=2',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '省市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
              //关联的更改的搜索字段
              related_key: 'businessId',
              //请求地址
              related_req_url: 'admin/estate/adminList',
              //默认请求
              related_req_param: {
                pageNo: 1,
                pageSize: 1000
              }
            },
            {
              en_name: 'businessId',
              zh_name: '项目名称',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: []
            },
            {
              en_name: 'sellType',
              zh_name: '活动类型',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: [{ value: 1, label: '秒杀' }, { value: 2, label: '竞拍' }]
            },

          ],
          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'channel',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'seckillActivityId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'name',
              zh_name: '活动名称',
            },
            {
              en_name: 'type',
              zh_name: '活动类型',
              render: (text) => {
                return (
                  <span>{['', '秒杀', '竞拍'][text]}</span>
                )
              }
            },
            {
              en_name: 'productNames',
              zh_name: '所属项目',
            },
            {
              en_name: 'productCitys',
              zh_name: '所属城市',
            },
          ],
          // 表格操作
          actions: [],
          pagination: {

          },
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '3': {  //资讯
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        api_url: 'admin/news/list',
        // 接口方式
        method: 'POST',
        // "data_field_name":"data",
        app: '',
        // 接口参数
        params: 'channel=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '省市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
              //关联的更改的搜索字段
              related_key: 'businessId',
              //请求地址
              related_req_url: 'admin/estate/adminList',
              //默认请求
              related_req_param: {
                pageNo: 1,
                pageSize: 1000
              }
            },
            {
              en_name: 'businessId',
              zh_name: '项目名称',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: []
            },
            {
              en_name: 'title',
              zh_name: '资讯标题',
              elem_type: 'Input',
              elem_valid_type: 'string',
            }

          ],
          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'channel',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'contentId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'title',
              zh_name: '资讯标题',
              width: 180
            },
            {
              en_name: 'channel',
              zh_name: '资讯类型',
              width: 100,
              render: (a, item, index, d, e, f) => {
                if (item.channel == 1) {
                  item.channel = '动态资讯'
                } else if (item.channel == 3) {
                  item.channel = '活动报名'
                }
                return (
                  <span>{item.channel}</span>
                )
              }
            },
            {
              en_name: 'businessName',
              zh_name: '项目名称',
            },
            {
              en_name: 'createTime',
              zh_name: '更新时间',
              width: 360
            },
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '5': {  //活动
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        api_url: 'admin/news/list',
        // 接口方式
        method: 'POST',
        // "data_field_name":"data",
        app: '',
        // 接口参数
        params: 'channel=3&status=1&published=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '省市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
              //关联的更改的搜索字段
              related_key: 'businessId',
              //请求地址
              related_req_url: 'admin/estate/adminList',
              //默认请求
              related_req_param: {
                pageNo: 1,
                pageSize: 1000
              }
            },
            {
              en_name: 'businessId',
              zh_name: '项目名称',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: []
            },
            {
              en_name: 'title',
              zh_name: '资讯标题',
              elem_type: 'Input',
              elem_valid_type: 'string',
            }

          ],
          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'channel',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'contentId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'title',
              zh_name: '资讯标题',
              width: 180
            },
            {
              en_name: 'channel',
              zh_name: '类型',
              width: 100,
              render: (a, item, index, d, e, f) => {
                if (item.channel == 1) {
                  item.channel = '动态资讯'
                } else if (item.channel == 3) {
                  item.channel = '活动报名'
                }
                return (
                  <span>{item.channel}</span>
                )
              }
            },
            {
              en_name: 'businessName',
              zh_name: '项目名称',
            },
            {
              en_name: 'createTime',
              zh_name: '更新时间',
              width: 360
            },
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '6': {   //预约看房
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        api_url: 'admin/estate/adminList',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        // 接口参数
        params: 'pageNo=1&pageSize=10&shelfStatus=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '城市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              changeOnSelect: true,
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'productId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'estateCode',
              zh_name: '项目编号',
              // width: 150,
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              // width: 100,
            },
            {
              en_name: 'cityName',
              zh_name: '所属城市',
              width: 150,
              // width: 100,
              render: (a, item, index, d, e, f) => {
                //console.log(item)
                let arr = ['北京市', '重庆', '上海', '天津']
                if (arr.indexOf(item.provinceName) > -1) {
                  return item.cityName
                } else {
                  return `${item.provinceName || ''}${item.provinceName && item.cityName && ' - ' || ''}${item.cityName || ''}`
                }

              }
            },
            {
              en_name: 'shelfStatus',
              zh_name: '状态',
              width: 80,
              render: (a, item, index, d, e, f) => {
                let shelfStatus = ['', '已上架', '已下架', '未上架']
                return (
                  <span>{shelfStatus[item.shelfStatus]}</span>
                )
              }
            },
            {
              en_name: 'createPerson',
              zh_name: '创建人',
              // width: 100,
            },
            {
              en_name: 'createTime',
              zh_name: '创建时间',
              width: 180
            },
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '7': {   //预约看房
      // ---------- 界面部分 ----------
      ui: {
        // 页面接口地址
        api_url: 'admin/estate/adminList',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        // 接口参数
        params: 'pageNo=1&pageSize=10&shelfStatus=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          fields: [
            {
              en_name: 'province',
              zh_name: '城市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              changeOnSelect: true,
              cmpt_items: areaList1,
              split_keys: ['province', 'city'],
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'productId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'estateCode',
              zh_name: '项目编号',
              // width: 150,
            },
            {
              en_name: 'name',
              zh_name: '项目名称',
              // width: 100,
            },
            {
              en_name: 'cityName',
              zh_name: '所属城市',
              width: 150,
              // width: 100,
              render: (a, item, index, d, e, f) => {
                //console.log(item)
                let arr = ['北京市', '重庆', '上海', '天津']
                if (arr.indexOf(item.provinceName) > -1) {
                  return item.cityName
                } else {
                  return `${item.provinceName || ''}${item.provinceName && item.cityName && ' - ' || ''}${item.cityName || ''}`
                }

              }
            },
            {
              en_name: 'shelfStatus',
              zh_name: '状态',
              width: 80,
              render: (a, item, index, d, e, f) => {
                let shelfStatus = ['', '已上架', '已下架', '未上架']
                return (
                  <span>{shelfStatus[item.shelfStatus]}</span>
                )
              }
            },
            {
              en_name: 'createPerson',
              zh_name: '创建人',
              // width: 100,
            },
            {
              en_name: 'createTime',
              zh_name: '创建时间',
              width: 180
            },
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },

    '9': {   //专题活动
      // ---------- 界面部分 ----------
      ui: {
        // api_url: "",
        api_url: '',
        // 接口方式
        method: 'POST',
        // "data_field_name":"data",
        app: '',
        // 接口参数
        params: '',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        mockData: cloneDeep(getTopicList()),
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },
          key: 'id',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'title',
              zh_name: '标题',
            },
            {
              en_name: 'linkUrl',
              zh_name: '链接',
            },
          ],
          // 表格操作
          actions: [],
          pagination: {

          },
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '10': {  //自助购房
      ui: {
        // 页面接口地址
        api_url: 'admin/liveBroadcast/queryPageByProjectId',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        selectedRowKeys: [],
        // 接口参数
        params: `pageNo=1&pageSize=10`,
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          fields: [
            {
              en_name: 'activityName',
              zh_name: '活动名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
            {
              en_name: 'projectName',
              zh_name: '项目名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },

          key: 'productId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'activityName',
              zh_name: '活动名称',
              // width: 150,
            },
            {
              en_name: 'zsxfsj',
              zh_name: '正式选房时间',
              width: 180,
              render: (a, item, index, d, e, f) => {
                return <span>{item.selectStartTime}~{item.selectEndTime}</span>
              }
            }
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '11': {  //在线选房
      ui: {
        // 页面接口地址
        api_url: 'admin/liveBroadcast/queryPageByProjectId',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        selectedRowKeys: [],
        // 接口参数
        params: `pageNo=1&pageSize=10&type=0`,
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          fields: [
            {
              en_name: 'activityName',
              zh_name: '活动名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
            {
              en_name: 'projectName',
              zh_name: '项目名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table':
        {
          rowSelectionInfo: {
            type: 'radio',
          },

          key: 'productId',
          status_params: 'status=0',
          status_text: '全部',
          // 表头字段列表
          scroll: { x: 800 },
          fields: [
            {
              en_name: 'activityName',
              zh_name: '活动名称',
              // width: 150,
            },
            {
              en_name: 'zsxfsj',
              zh_name: '正式选房时间',
              width: 180,
              render: (a, item, index, d, e, f) => {
                return <span>{item.selectStartTime}~{item.selectEndTime}</span>
              }
            }
          ],
          // 表格操作
          actions: [],
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '12': {  //小游戏
      'ui': {
        // 页面接口地址
        'api_url': 'mideadc-game-center-service/activity/gameActivity/list',
        "data_field_name": "result.records",
        "data_pageNo": "result.current",
        "data_pageSize": "result.size",
        "data_total": "result.total",
        // 接口方式
        'method': 'GET',
        'app': 'isales-mgmt-application',
        selectedRowKeys: [],
        // 接口参数
        'params': 'releaseStatus=1',
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        'mockData': null,
        // 查询栏
        'search_bar': {
          'fields': [
            {
              en_name: 'title',
              zh_name: '活动名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
          ],
          searchHandler: (p) => { // 自定义搜索按钮回调函数，点击搜索时触发

          },
          resetHandler: (p) => { // 自定义重置按钮回调函数，点击重置时触发
            // console.log('reset click', p)
          },
          searchCallback: params => { // 自定义搜索完成后的后调函数, 搜索完成后触发, 并将本次搜索的参数传入
            // console.log('search finish', params)
          },
        },
        // 数据表格
        'table': {
          rowSelectionInfo: {
            type: 'radio'
          },
          'status_params': 'status=0',
          'status_text': '全部',
          'scroll': { x: 1600 },
          // 表头字段列表"
          'fields': [
            {
              'en_name': 'gameImgUrl',
              'zh_name': '活动类型缩略图',
              width: 50,
              render: (a, item, index, d, e, f) => {
                return <img style={{ width: "50px", height: '50px' }} src={a} />
              }
            },
            {
              'en_name': 'title',
              'zh_name': '活动名称',
              width: 200
            },
            {
              'en_name': 'uuseeConfigName',
              'zh_name': '活动时间',
              width: 90,
              render: (text, item) => {
                return <div>{`${item.startTime.split(' ')[0] || ''}${item.endTime && ' ~ ' || ''}${item.endTime.split(' ')[0] || ''}`}</div>
              }
            },
            {
              'en_name': 'type',
              'zh_name': '活动状态',
              width: 100,
              render: (a, item, index, d, e, f) => {
                if (item.status == '0') {
                  return <div>未发布</div>
                }
                else if (item.status == '1') {
                  return <div>未开始</div>
                }
                else if (item.status == '2') {
                  return <div>进行中</div>
                }
                else if (item.status == '3') {
                  return <div>已结束</div>
                } else {
                  return <div>-</div>
                }
              }
            },
            {
              'en_name': 'createPerson',
              'zh_name': '创建人',
              width: 100,
            },
            {
              'en_name': 'createTime',
              'zh_name': '创建时间',
              width: 180
            }
          ],

          'actions': [
          ],
          "action_props": {
            fixed: "right",
            width: 210
          }
        },
        // 操作栏
        action_bar: [
          {
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      }
    },
    '13': {  //直播列表
      ui: {
        // 页面接口地址
        api_url: 'admin/liveBroadcast/queryList',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        selectedRowKeys: [],
        // 接口参数
        params: ``,
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          'fields': [
            {
              en_name: 'province',
              zh_name: '省市',
              elem_type: 'Cascader',
              elem_valid_type: 'string',
              cmpt_items: areaList1,
              //关联的更改的搜索字段 
              related_key: 'productId',
              //请求地址
              related_req_url: 'admin/estate/adminList',
              //默认请求
              related_req_param: {
                pageNo: 1,
                pageSize: 1000
              },
              split_keys: ['provinceCode', 'cityCode'],
            },
            {
              en_name: 'productId',
              zh_name: '项目名称',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: []
            },
            {
              en_name: 'title',
              zh_name: '直播标题',
              elem_type: 'Input',
              elem_valid_type: 'string',
            },
            {
              en_name: 'type',
              zh_name: '直播类型',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: [
                {
                  value: '3',
                  label: '预告'
                },
                {
                  value: '1',
                  label: '直播'
                },
                {
                  value: '2',
                  label: '回放'
                }
              ]
            },
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'carName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table': {
          rowSelectionInfo: {
            type: 'radio',
          },
          'status_params': 'status=0',
          'status_text': '全部',
          'scroll': { x: 1600 },
          // 表头字段列表"
          'fields': [
            {
              en_name: "key",
              zh_name: "序号",
              width: "60",
              render: (a, item, index, d, e, f) => {
                return index + 1
              },
            },
            {
              'en_name': 'city',
              'zh_name': '城市',
              width: 200,
              render: (a, item, index, d, e, f) => {
                // console.log(a, item, index, d, e, f)
                return <span>{item.provinceName}-{item.cityName}</span>
              }
            },
            {
              'en_name': 'productName',
              'zh_name': '项目',
              width: 200
            },
            {
              'en_name': 'title',
              'zh_name': '直播标题',
              width: 200
            },
            {
              'en_name': 'uuseeConfigName',
              'zh_name': '直播平台',
              width: 90
            },
            {
              'en_name': 'type',
              'zh_name': '直播类型',
              width: 90,
              render: (a, item, index, d, e, f) => {
                return <span>{{ 1: '直播', 2: '回放', 3: '预告' }[a]}</span>
              }
            },
            {
              'en_name': 'published',
              'zh_name': '发布状态',
              width: 90,
              render: (a, item, index, d, e, f) => {
                return <span>{{ 0: '未发布', 1: '已发布' }[a]}</span>
              }
            },
            {
              'en_name': 'counselorName',
              'zh_name': '主播',
              width: 100
            },

            {
              'en_name': 'data',
              'zh_name': '直播时间',
              width: 180,
              render: (a, item, index, d, e, f) => {
                return (
                  <div>
                    <div>{item.effectiveStartTime}</div>
                    <div>{item.effectiveEndTime}</div>
                  </div>
                )

              }
            }
          ],

          'actions': [
          ],
          "action_props": {
            fixed: "right",
            width: 210
          }
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },
    '14': {  //直播列表
      ui: {
        // 页面接口地址
        api_url: 'admin/activityArea/list',
        // 接口方式
        method: 'POST',
        headers: {
          'Content-type': 'application/json'
        },
        app: '',
        selectedRowKeys: [],
        // 接口参数
        params: ``,
        // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
        // "mockData": mockData,
        mockData: null,
        // 查询栏
        search_bar: {
          'fields': [
            {
              en_name: 'activityAreaName',
              zh_name: '专区名称',
              elem_type: 'Input',
              elem_valid_type: 'string',
              //关联的更改的搜索字段
              // related_key: 'businessId',
              // //请求地址
              // related_req_url: 'admin/estate/list',
              // //默认请求
              // related_req_param: {
              //   pageNo: 1,
              //   pageSize: 1000
              // }
            },

            {
              en_name: 'status',
              zh_name: '状态',
              elem_type: 'Select',
              elem_valid_type: 'string',
              cmpt_items: [
                {
                  value: '0',
                  label: '未发布'
                },
                {
                  value: '1',
                  label: '已发布'
                },
              ],
            }
          ],

          pasteTargetList: [  // 列表组件中将输入框的en_name作为默认id(也可以通过id另外设置)
            'activityAreaName',  // 将需要粘贴事件拦截的输入框id以数组的形式传入, 该参数对应PasteFromClipboard组件的targetList参数
          ]
        },
        // 数据表格
        'table': {
          rowSelectionInfo: {
            type: 'radio',
          },
          'status_params': 'status=0',
          'status_text': '全部',
          'scroll': { x: 1600 },
          // 表头字段列表"
          'fields': [
            {
              en_name: "activityAreaName",
              zh_name: "专区名称",
              //width:130
            },

            {
              en_name: "regionName",
              zh_name: "所属区域",
              // width:180
            },
            {
              en_name: "creator",
              zh_name: "更新人",
              // width:80,
            },
            {
              en_name: "createTime",
              zh_name: "更新时间",
              // width:180
            },
          ],

          'actions': [
          ],
          "action_props": {
            fixed: "right",
            width: 210
          }
        },
        action_bar: [
          {
            // label:'',
            // type:'',
            rowSelection: [],
            render: () => {
              return <Input hidden />
            },
            onClick: (e, row) => {
              console.log(e, row)
            }
          },
        ]
      },
    },

  };

  (['1', '2', '3', '5', '6', '7', '9', '10', '11', '12', '13', '14']).map((item, index) => {
    let _biz = biz[item + '']
    if (!!_biz) {
      pageProps[item + ''].biz = _biz
      pageProps[item + ''].biz.syncBackCbf = (newbiz) => {
        if (item == hrefModalObj.hrefType) {
          newbiz.selectedRowKeys = currentItem
        }
        biz[item + ''] = newbiz
        dispatch({
          type: `${namespace}/updateStore`,
          payload: { biz }
        })
      }
    }
  })
  // 分页表格属性配置
  let pageProps2 = {
    // ---------- 界面部分 ----------
    ui: {
      // 页面接口地址
      api_url: "admin/estate/adminList",
      // 接口方式
      method: "POST",
      headers: {
        "Content-type": "application/json"
      },
      app: "",
      // 接口参数
      params: "pageNo=1&pageSize=10&shelfStatus=1",
      // 模拟数据 - 用于开发需要，若填充了上面的api_url之后，请将此项设置为null
      // "mockData": mockData,
      mockData: null,
      // 查询栏
      search_bar: {
        fields: [
          {
            en_name: 'province',
            zh_name: '城市',
            elem_type: 'Cascader',
            elem_valid_type: 'string',
            changeOnSelect: true,
            cmpt_items: areaList1,
            split_keys: ['province', 'city'],
          },
          {
            en_name: 'name',
            zh_name: '项目名称',
            elem_type: 'Input',
            elem_valid_type: 'string',
          },
        ],

      },
      // 数据表格
      "table":

      {
        rowSelectionInfo: {
          type: 'radio',
        },
        status_params: "status=0",
        status_text: "全部",
        // 表头字段列表

        key: 'productId',
        fields: [
          {
            en_name: "name",
            zh_name: "项目名称",
            width: 180,
          },
          {
            en_name: "cityName",
            zh_name: "所属城市",
            width: 150,
            render: (a, item, index, d, e, f) => {
              //console.log(item)
              let arr = ['北京市', '重庆', '上海', '天津']
              if (arr.indexOf(item.provinceName) > -1) {
                return item.cityName
              } else {
                return `${item.provinceName || ''}${item.provinceName && item.cityName && ' - ' || ''}${item.cityName || ''}`
              }

            }
          },
          {
            en_name: "saleArea",
            zh_name: "在售面积",
            width: 110,
          },
          {
            en_name: "avePrice",
            zh_name: "均价(元/㎡)",
            width: 120,
          },
          {
            en_name: "propertyRight",
            zh_name: "产权年限",
            width: 110,
          },

        ],
      },
      action_bar: [
        {
          // label:'',
          // type:'',
          rowSelection: [],
          render: () => {
            return <Input hidden />
          },
          onClick: (e, row) => {
            console.log(e, row)
          }
        },
      ]
    },
  }
  if (!!modelObj.biz) {
    pageProps2.biz = modelObj.biz2
    pageProps2.biz.syncBackCbf = (biz) => {
      //console.log(biz)
      biz.selectedRowKeys = [query.productId]
      dispatch({
        type: `${namespace}/updateStore`,
        payload: { biz2: biz }
      })
    }
  }
  //动态增加form表单
  const formItems1 = query.provinceCodes && query.provinceCodes.map((k, index) => (
    <Row>
      <Col span={6}>
        <Form.Item
          {...formItemLayout2}
          required={false}
          key={index}
        >
          {getFieldDecorator(`provinceCodes[${index}]`, {
            validateTrigger: ['onChange', 'onBlur'],
            rules: [{
              required: true,
              whitespace: true,
              message: "请选择或者删除此范围",
            }],
            initialValue: query.provinceCodes[index]
          })(
            <Select onSelect={(value, option) => { getProvince(value, option, index) }} disabled={actionType == 'detail'} >
              {<Select.Option value='0' key='0' disabled={!JSON.parse(clique)}>全国</Select.Option>}

              {areaList1.map((item, i) => {
                return (
                  <Select.Option value={item.value} key={JSON.stringify(item.children)}>{item.label}</Select.Option>
                )
              })}
            </Select>
          )}
        </Form.Item>
      </Col>

      {query.provinceCodes && query.provinceCodes.length > 1 && actionType != 'detail' ? (
        <Col span={2}>
          <Icon
            className="dynamic-delete-button"
            type="minus-circle-o"
            disabled={query.provinceCodes.length === 1}
            onClick={() => remove(index)}
          />
        </Col>
      ) : null}
    </Row>

  ));
  //增加全选
  function onCheckAllChange(y, e) {
    let arr = []
    if (e.target.checked) {
      city[y].forEach((item, idx) => {
        arr.push(item.value)
      })
    }
    query.cityCodes[y] = arr
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query }
    })
    form.resetFields([`cityCodes[${y}]`])
  }
  const formItems2 = query.cityCodes && query.cityCodes.map((x, y) => (
    <div>
      <div >
        {console.log(query.provinceCodes, query.provinceCodes.length)}
        {!query.wholeCountry && query.provinceCodes[y] > 0 ? <Checkbox
          disabled={actionType == 'detail'}
          indeterminate={query.cityCodes[y] && city[y] && query.cityCodes[y].length != 0 && (query.cityCodes[y].length != city[y].length)}
          onChange={(e) => onCheckAllChange(y, e)}
          checked={query.cityCodes[y] && city[y] && (query.cityCodes[y].length == city[y].length)}
        >
          全选
            </Checkbox> : null}
      </div>
      <Form.Item
        required={false}
        key={y}
      >
        {getFieldDecorator(`cityCodes[${y}]`, {
          initialValue: query.cityCodes[y],
        })(
          <Checkbox.Group disabled={actionType == 'detail'} options={city[y] ? city[y] : []} style={{ width: "100%" }} onChange={(value) => getCity(value, y)}>
          </Checkbox.Group>
        )}
      </Form.Item>

    </div>

  ));
  const formItems = formItems1 && formItems1.map((x, y) => (
    <div key={y}>{formItems1[y]}{formItems2[y]}</div>))


  //删除form表单函数
  function remove(k) {
    query.provinceCodes = query.provinceCodes.filter((key, index) => index !== k)
    query.cityCodes = query.cityCodes.filter((key, index) => index !== k)
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { city, query }
    });
  }
  //增加form表单函数
  function add() {
    if (query.wholeCountry) {
      message.error("已选择了全国地区，无需再添加活动地区");
      return false;
    }
    query.provinceCodes.push("")
    query.cityCodes.push([])
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query }
    });

  }
  //判断当选择的全部城市是多选框的全国默认被选上，并且不可用
  function getProvince(e, option, i) {
    if (e == 0) {
      query.wholeCountry = true
    } else if (e != 0) {
      query.wholeCountry = false
      query.cityCodes[i] = []
    }
    query.provinceCodes[Number(i)] = e
    city[i] = JSON.parse(option.key)
    form.resetFields([`cityCodes[${i}]`])
    form.resetFields([`provinceCodes[${i}]`])
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { city, query }
    });
    form.resetFields(['useRange'])
  }

  //获取所选城市
  function getCity(e, i) {

    query.cityCodes[i] = e
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query }
    });
  }
  //获取所选项目的城市
  function getSelected(e, option) {
    let num = JSON.parse(option.key)
    console.log(num)
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { num }
    });
  }
  //保存
  function submit() {
    validateFields((err, values) => {
      console.log(err)
      if (!err) {
        dispatch({
          type: `${namespace}/submit`,
          payload: {}
        })
      }
    });
  }
  // 验证并打开确认框
  function comfiraudit() {
    validateFields((err, values) => {
      console.log(err)
      if (!err) {
        dispatch({
          type: `${namespace}/updateStore`,
          payload: { confirmAudit: true }
        })
      }
    });
  }
  // 确认保存并提交（先调保存接口再提交）
  function confirmAuditOk() {
    dispatch({
      type: `${namespace}/submit`,
      payload: { AuditOk: true }
    })

  }
  // 驳回审核
  function ignore(params) {
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { ignoreReason: true }
    })
  }
  // 提交驳回请求
  function confirmignore() {
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { ignoreReason: false }
    })
    changAdvertisementAuditsubmit(-1, auditDesc)
  }
  // 审核通过/取消审核/驳回
  function changAdvertisementAuditsubmit(auditStatus, reson = null) {
    let params = {
      advertisementId,
      auditStatus,
      auditDesc: reson != null ? reson : ''
    }
    dispatch({
      type: `${namespace}/advertisementAuditsubmit`,
      payload: params
    })
  }
  //上传图片
  function updateImageModel(value, type) {
    inputChange(value, type)
  };
  //获取动态图
  function getGif(e) {
    query.gifimg = e.target.value
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query }
    })
  }

  //删除上传的图片
  function removeImgUrl(type) {
    if (type == 'gifimg') {
      localGif = '',
        query.gifimg = ''
    } else if (type == 'img') {
      query.img = ''
    }
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query, localGif }
    });
  }
  //随机选择动态图片
  function random() {
    let i = Math.floor(Math.random() * 6)
    while (1) {
      if (query.gifimg == gif[i]) {
        i = Math.floor(Math.random() * 6)
      } else {
        break;
      }
    }
    console.log(gif[i])
    query.gifimg = gif[i]
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { query }
    });
  }
  //是否选择本地图片
  function onChangeTolocal() {
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { local: !local }
    });
  }
  function onChangeTextArea(e) {
    dispatch(
      {
        type: `${namespace}/updateStore`,
        payload: { auditDesc: e }
      }
    )
  }
  //输入框改变时
  function inputChange(e, name) {
    // console.log("eeeeeeeeeeee",e,name)
    if (name == 'productType') {
      hrefModalObj.linkUrl = ''
      dispatch(
        {
          type: `${namespace}/updateStore`,
          hrefModalObj
        }
      )
    }
    dispatch({
      type: `${namespace}/updateStore`,
      payload: {
        query: {
          ...query,
          [name]: e,
        }
      }
    })
  }
  //选择项目
  function openModal() {
    hrefModalObj.secvisible = true
    form.resetFields(['productId'])
    changeState({ hrefModalObj })
  }
  //日期改变时
  function dateChange(m, s) {
    console.log(m, s)
    dispatch({
      type: `${namespace}/updateStore`,
      payload: {
        query: {
          ...query,
          startDate: s[0],
          endDate: s[1],
        }
      }
    })
  }

  const changeState = (payload) => {
    console.log(payload)
    dispatch({
      type: `${namespace}/updateStore`,
      payload: { ...payload }
    })
  }
  function updateModal(flag = false, obj = {}) {
    let visible = flag
    hrefModalObj.visible = flag
    if (!visible) { //关闭
      changeState({ hrefModalObj, })
      return false
    }
    form.resetFields(['new_href'])
    form.resetFields(['linkType'])
    changeState({ hrefModalObj })
  }
  // 处理审核状态
  function filterAudit(params) {
    switch (params) {
      case -1:
        return '审核驳回'
        break;
      case 0:
        return '待审核'
        break;
      case 1:
        return '审核中'
        break;
      case 2:
        return '已审核'
        break;
    }
  }

  return (
    <div className={cx('pageLayout')}>
      <div className='public_listMain'>
        <div className={"functionButton"}>
          {
            (actionType == "detail" || actionType == "edit") && query.auditDesc && query.auditStatus === -1 ?
              <FlagBtn node={<span>
                <Icon type="close-circle" className={cx('close-circle')} />
                <span className={cx('ml10')}>审核被驳回</span>
                <Popover placement="bottom" content={query.auditDesc}>
                  <span className={[cx('ml10'), cx('mr30')].join(' ')}>驳回原因</span>
                </Popover>
              </span>} btnId={''}> </FlagBtn>
              : ''
          }
          {/* 审核状态：auditStatus    -1审核驳回，0待审核，1审核中，2已审核 */}
          {actionType == "edit" && query.auditStatus === 2 ?
            <FlagBtn node={<Button type='primary' ghost onClick={(e) => changAdvertisementAuditsubmit(0)} loading={loadingGroup['0']} >取消审核</Button>} btnId={'30104'}> </FlagBtn>
            : null}
          {actionType == "edit" && query.auditStatus === 1 ?
            <FlagBtn node={<Button type='primary' className={cx('ml15')} ghost onClick={(e) => ignore()} loading={loadingGroup['-1']}>驳回</Button>} btnId={'30104'}> </FlagBtn>
            : null}
          {actionType == "edit" && query.auditStatus === 1 ?
            <FlagBtn node={<Button className={cx('ml15')} type='primary' onClick={() => changAdvertisementAuditsubmit(2)} loading={loadingGroup['2']}>审核通过</Button>} btnId={'30104'}> </FlagBtn>
            : null}
          {actionType == "add" || (actionType == "edit"&&query.auditStatus <= 0) ?
            <FlagBtn node={<Button type='primary' className={cx('ml15')} onClick={() => submit()} loading={btnLoading}>保存</Button>} btnId={'30103'}> </FlagBtn>
            : null}
          {actionType == "add" ||( actionType == "edit"&&query.auditStatus <= 0 )?
            <FlagBtn node={<Button type='primary' className={cx('ml15')} onClick={() => comfiraudit()} loading={loadingGroup['1']}>提交审核</Button>} btnId={'30101'}> </FlagBtn>
            : null} 
        </div>
        <CollapsiblePanels title="首页横幅信息" hideUpDownBtn={true} auditStatus={actionType != "add" ? `审核状态：${filterAudit(query.auditStatus)}` : ''} sTitle={actionType == 'detail' ? `状态：${['', '已上架', '已下架', '', '未上架'][query.status]}` : ''}>
          <FormItem label='所属区域'  {...formItemLayout}>
            {getFieldDecorator('regionName', {
              rules: [{
                required: false, message: '请输入所属区域名称'
              }],
              initialValue: query.regionName ? query.regionName + '' : undefined
            })(
              <Input disabled={actionType == 'detail' || true} />
            )}
          </FormItem>
          <Row>
            <Col span={12}>
              <FormItem label='横幅名称'  {...formItemLayout2}>
                {getFieldDecorator('title', {
                  rules: [{
                    required: true, whitespace: true, message: '请输入活动名称'
                  }],
                  initialValue: query.title ? query.title + '' : undefined
                })(
                  <Input disabled={actionType == 'detail'} placeholder='请输入活动名称' onChange={(e) => { inputChange(e.target.value, 'title') }} />
                )}
              </FormItem>
            </Col>
            {/* <Col span={8}>
              <FormItem label='状态'  {...formItemLayoutStatus}>
                {getFieldDecorator('status', {
                  rules: [{
                    required: true, message: '请选择状态'
                  }],
                  initialValue: query.status ? query.status + '' : undefined
                })(
                  <Select disabled={actionType == 'detail'} placeholder="请选择状态" onChange={e => inputChange(e, 'status')}>
                    <Select.Option value='1'>上架</Select.Option>
                    <Select.Option value='2'>下架</Select.Option>
                    <Select.Option value='4'>未上架</Select.Option>
                  </Select>
                )}
              </FormItem>
            </Col>
            <Col span={4}>
              <Tooltip title="活动入口在上架状态时将显示在美的置业云小程序；下架状态则不显示"><Icon type="question-circle" style={{ fontSize: '16px', color: '#08c', marginLeft: '8px', marginTop: '8px' }} /></Tooltip>
            </Col> */}

          </Row>
          <Row>
            <Col span={12}>
              <FormItem label='投放位置'  {...formItemLayout2}>
                {getFieldDecorator('productType', {
                  rules: [{
                    required: true, whitespace: true, message: '请输入投放位置'
                  }],
                  initialValue: query.productType || query.productType == 0 ? query.productType + '' : undefined
                })(
                  <Select disabled={actionType == 'detail'} placeholder='请选择投放位置' onChange={(e) => { inputChange(e, 'productType') }}>
                    <Select.Option value="0">美的置业云</Select.Option>
                    <Select.Option value="1">智美分销</Select.Option>
                    {/* <Select.Option value="2">置业神器</Select.Option> */}
                  </Select>
                )}
              </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span={12}>
              <FormItem label='广告位置'  {...formItemLayout2}>
                {getFieldDecorator('location', {
                  rules: [{
                    required: true, message: '请输入广告位置'
                  }],
                  initialValue: query.location ? query.location + "" : undefined
                })(
                  <Select disabled={actionType == 'detail'} placeholder='请输入广告位置' onChange={(e) => {
                    console.log(biz[hrefModalObj.hrefType], hrefModalObj.hrefType)
                    delete query.productId
                    delete query.productName
                    delete hrefModalObj.btnName
                    delete hrefModalObj.linkUrl
                    hrefModalObj.hrefType = ''

                    dispatch({
                      type: `${namespace}/updateStore`,
                      payload: {
                        hrefModalObj,
                        query, biz
                      }
                    })

                    inputChange(e, 'location')
                  }}>
                    <Select.Option value="1">首页</Select.Option>
                    <Select.Option value="2">美房详情</Select.Option>
                  </Select>
                )}
              </FormItem>
            </Col>
            {query.location == 2 ?
              <Col span={8}>
                <FormItem label='项目名称'  {...formItemLayout2}>
                  {getFieldDecorator('productId', {
                    rules: [{
                      validator: function (rule, str, callback) {
                        console.log('----------------------------------')
                        if (query.productId) {
                          callback();
                        } else {
                          callback('请选择项目');
                        }
                      }//todo
                    }],
                    //initialValue: query.productId ?  query.productId+"" : undefined
                  })(
                    <div>
                      <Button onClick={() => openModal()}>选择项目</Button>
                      <span style={{ marginLeft: 20 }}> {query.productName}</span>
                    </div>
                  )}
                </FormItem>
              </Col> : null}
          </Row>
          <Row>
            <FormItem
              {...formItemLayoutForTime}
              label="生效时间"
              extra={!query.wholeCountry ? "注：同一时间，如果美的置业云首页有集团设置的弹窗广告，将只会显示集团设置的弹窗广告,生效时间最长设置时间为15天" : "注：同一时间，如果美的置业云首页有集团设置的弹窗广告，将只会显示集团设置的弹窗广告"}
            >
              {getFieldDecorator('effectiveTime', {
                rules: [{ required: true, message: '请选择生效时间' },
                ],
                initialValue: query.startDate ? [moment(query.startDate, 'YYYY-MM-DD HH:mm:ss'), moment(query.endDate, 'YYYY-MM-DD HH:mm:ss')] : [],
              })(
                <RangePicker disabled={actionType == 'detail'} showTime={{
                  hideDisabledOptions: true,
                  defaultValue: [moment(null, 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],

                }}
                  //   ranges={{ "今天后几分钟": [moment().add(5, 'm'), moment().add(15, 'd')], }}
                  format="YYYY-MM-DD HH:mm:ss" onChange={(date, dateString) => { dateChange(date, dateString) }}
                  onOk={(date) => {
                    if (!query.wholeCountry) {
                      if (date[1].diff(date[0], 'days') > 15) {
                        query.startDate = null
                        query.endDate = null
                        dispatch({
                          type: 'updateStore',
                          payload: {
                            query
                          }
                        })
                        form.resetFields(['effectiveTime'])
                        message.error('设置生效日期的范围最长不能超过15天', () => {
                        })
                        return false
                      }
                    }

                  }}
                />

              )}
            </FormItem>
          </Row>
          <Row>
            <Col span={6}>
              <FormItem label='跳转页面' required={true} {...formItemLayout1}>
                {getFieldDecorator('linkType', {
                  rules: [
                    {
                      validator: function (rule, str, callback) {
                        if (hrefModalObj.linkUrl || query.linkType == '8') {

                          callback();

                        } else {
                          callback('请选择链接');
                        }
                      }//todo
                    }
                  ],
                })(
                  <Button disabled={actionType == 'detail'} onClick={() => { updateModal(true) }}>选择链接</Button>
                )}
              </FormItem>
            </Col>
            {hrefModalObj.btnName ? <Col span={8} >
              <FormItem>
                <span><span style={{ fontSize: 12 }}> 名称: </span> {hrefModalObj.btnName}</span>
              </FormItem>
            </Col> : null}
            {hrefModalObj.hrefType ? <Col span={6}>
              <FormItem >
                <span><span style={{ fontSize: 12 }}>跳转类型:</span> {objhref[query.linkType]}</span>
              </FormItem>
            </Col> : null}
          </Row>
          {hrefModalObj.linkUrl ? <Row>
            <FormItem>
              <span><span style={{ fontSize: 12, marginLeft: '8%' }}>跳转Url: </span> {hrefModalObj.linkUrl}</span>
            </FormItem>
          </Row> : null}
          <FormItem
            {...formItemLayout}
            extra="图片分辨率需为1372px*256px，且文件大小在500kb以下，支持jpg，png格式。"
            label="首页活动图"

            required='true'>
            <Uploader uploadedUrls={query.img}
              removeFileCbf={() => { removeImgUrl('img') }}
              uploadSuccessCbf={(imgUrl) => {
                console.log(imgUrl)
                updateImageModel(imgUrl, 'img')
                // form.resetFields['img']
              }}
              showType={actionType == 'detail' ? '4' : "6"}
              minCropBoxWidth={1372}
              minCropBoxHeight={256}
              unsetWidth={true}
              fileType='image'
              fileMaxSize='0.5'
              maxFiles='1'

            />
          </FormItem>
          <span style={{ color: "#666", fontSize: "12px" }}>预览图:</span>
          <div className={cx('box')} style={{ marginTop: '10px' }}>

            <div className={cx('preview')}>
              {<div>
                {query.img ? <img src={query.img} style={{ 'width': '343px', 'height': '71px' }} alt="" />
                  : null}
                {query.gifimg && !query.dynamic ? <img src={query.gifimg} style={{ 'width': '40px', 'height': '40px', 'position': 'absolute', 'right': '6px', 'top': '16px' }} alt="" /> : null}
              </div>
              }
            </div>
            <div style={{ 'width': '110px', 'marginLeft': '20px' }}>
              {
                actionType == 'detail' ? null :
                  <div>
                    <Button type='primary' disabled={query.dynamic} onClick={() => { random() }}>随机换动态图</Button>
                    <Button type='primary' disabled={query.dynamic} style={{ 'marginTop': '10px' }} onClick={() => {
                      dispatch({
                        type: `${namespace}/updateStore`,
                        payload: { visible: true }
                      })
                    }}>手动更换</Button>
                    <Checkbox onChange={e => { inputChange(e.target.checked, 'dynamic') }} checked={query.dynamic} style={{ 'marginTop': '10px' }}>不使用动态图</Checkbox>
                  </div>
              }
            </div>
          </div>
          {query.location == 1 ?
            <div>
              <FormItem>
                <Row>
                  <div style={{ "fontWeight": "600" }}>使用范围</div>
                </Row>
              </FormItem>
              {formItems}
              {actionType == 'detail' ? null :
                <FormItem>
                  {getFieldDecorator('useRange', {
                    rules: [{
                      validator: function (rule, str, callback) {
                        if (query.wholeCountry || query.provinceCodes.length > 0) {
                          callback();
                        } else {
                          callback('请选择城市范围');
                          message.error('请选择或新增活动范围')
                        }
                      }
                    }
                    ],
                  })(
                    <Button type='primary' onClick={() => add()}>新增活动范围</Button>)}
                </FormItem>
              }
            </div> : null
          }

        </CollapsiblePanels>
      </div>

      <Modal
        width='60%'
        title="选择默认动态图"
        onOk={() => {
          dispatch({
            type: `${namespace}/updateStore`,
            payload: { visible: false }
          })
        }}
        visible={visible && actionType != 'detail'}
        onCancel={() => {
          dispatch({
            type: `${namespace}/updateStore`,
            payload: { visible: false }
          })
        }}
      >
        {actionType == 'detail' ? null :
          <div style={{ "width": "100%" }}>
            <div className={cx('box')}>
              <div className={cx('preview')}>
                {
                  query.img ? <img src={query.img} style={{ 'width': '343px', 'height': '71px' }} alt="" />
                    : <div style={{ 'fontSize': '20px', 'color': 'blue', 'lineHeight': '71px', 'textAlign': 'center' }}>未上传活动图</div>
                }
                <img src={query.gifimg} style={{ 'width': '40px', 'height': '40px', 'position': 'absolute', 'right': '6px', 'top': '16px' }} alt="" />
              </div>
            </div>

            <Radio.Group style={{ 'marginTop': '20px' }} onChange={e => { getGif(e) }} defaultValue={query.gifimg}>

              {!local ? <Row >
                <Col span={4}>
                  <Uploader uploadedUrls={query.gifimg}
                    removeFileCbf={() => { removeImgUrl('gifimg') }}
                    uploadSuccessCbf={(imgUrl) => { updateImageModel(imgUrl, 'gifimg') }}
                    showType={actionType == 'detail' ? '4' : "6"}
                    minCropBoxWidth={176}
                    minCropBoxHeight={176}
                    fileMaxSize='0.05'
                    maxFiles='1'
                    disabled={local}
                  />
                </Col>
                <Col span={16}>
                  <span>图片分辨率需为176px*176px，且文件大小在50kb以下，支持jpg，png格式。</span>
                </Col>

              </Row> : null}
              <Checkbox onChange={onChangeTolocal}>本地图片</Checkbox>
              <div style={{ 'marginTop': '20px' }}>
                <Row>
                  <Col span={8}>
                    <img src={gif[0]} style={{ 'width': '100px', 'height': '100px' }} alt="" />    <div className={cx('center')}><Radio value={gif[0]} disabled={!local}>选择</Radio></div>

                  </Col>
                  <Col span={8}>
                    <img src={gif[1]} style={{ 'width': '100px', 'height': '100px' }} alt="" />    <div className={cx('center')}><Radio value={gif[1]} disabled={!local}>选择</Radio></div>

                  </Col>
                  <Col span={8}>
                    <img src={gif[2]} style={{ 'width': '100px', 'height': '100px' }} alt="" />    <div className={cx('center')}><Radio value={gif[2]} disabled={!local}>选择</Radio></div>

                  </Col>

                </Row>
                <Row style={{ 'marginTop': '40px' }}>
                  <Col span={8}>
                    <img src={gif[3]} style={{ 'width': '100px', 'height': '100px' }} alt="" />     <div className={cx('center')}><Radio value={gif[3]} disabled={!local}>选择</Radio></div>

                  </Col>
                  <Col span={8}>
                    <img src={gif[4]} style={{ 'width': '100px', 'height': '100px' }} alt="" />
                    <div className={cx('center')}><Radio value={gif[4]} disabled={!local}>选择</Radio></div>
                  </Col>
                  <Col span={8}>
                    <img src={gif[5]} style={{ 'width': '100px', 'height': '100px' }} alt="" />    <div className={cx('center')}><Radio value={gif[5]} disabled={!local}>选择</Radio></div>

                  </Col>

                </Row>
              </div>

            </Radio.Group>
            <div>

            </div>
          </div>
        }
      </Modal>
      {/*链接弹窗*/}
      <SelectModal
        visible={hrefModalObj.visible}
        updateModal={updateModal}
        pageProps={pageProps}
        hrefModalObj={hrefModalObj}
        form={form}
        channelIndex={channelIndex}
        changeState={changeState}
        confirmHref={confirmHref}
      />

      <Modal
        visible={hrefModalObj.secvisible}
        onOk={() => {
          hrefModalObj.secvisible = false
          console.log(biz2)
          set(query, 'productId', biz2.selectedRowKeys[0])
          set(query, 'productName', biz2.selectedRows[0].name)
          changeState({ query })
        }}
        onCancel={() => {
          hrefModalObj.secvisible = false
          changeState({ hrefModalObj })
        }}
        width={'80%'}
      >
        <div title="美房详情" >
          <ListPage pageProps={pageProps2} />
        </div>
      </Modal>

      {/* 确认提交审核 */}
      <Modal
        visible={confirmAudit}
        onOk={() => confirmAuditOk()}
        cancelText="我再想想"
        okText="确认并提交"
        onCancel={() => {
          dispatch({
            type: `${namespace}/updateStore`,
            payload: { confirmAudit: false }
          })
        }}
      >
        <p>提交后需要集团审批通过方可生效，请检查图片是否符合以下要求：</p>
        <p>图片清晰美观；</p>
        <p>符合尺寸要求；</p>
        <p>符合美的置业云页面主题配色；</p>
      </Modal>
      {/* 驳回原因 */}
      <Modal
        visible={ignoreReason}
        title="驳回原因"
        onOk={() => confirmignore()}
        cancelText="取消"
        okText="确认"
        onCancel={() => {
          dispatch({
            type: `${namespace}/updateStore`,
            payload: { ignoreReason: false }
          })
        }}
      >
        <TextArea

          onChange={(e) => onChangeTextArea(e.target.value)}
          placeholder="请输入驳回原因"
          rows={6}
          autoSize={true}
        />
      </Modal>
    </div>

  )
}
// 连接视图(view)和模型(model)
export default connect(mapStateToProps)(Form.create()(homeBannerDetailView))
